Fixed Makefile and compiler bugs