updated makefile. refactored some stuff around