Fixed compile errors and updated Makefile