Fixed some issues with compiling using the Makefile and fixed some minor bugs.