fix some compile errors
Makefile enhancements + fix some compile errors