fixing makefile, compiling, and linking errors