Remove makefile cruft and fix all the compiler warnings. Change-Id: I24e40143cac47a566c191f4f1ca27df7b4f55821