Fixed link issues, improved makefile