Changed makefile to create object files and link them, and fixed dependencies within the .h and .cpp files to make the new Makefile work