build fixes and Makefile updates