clean up Makefile and fix compilation