Makefile now works, but need to rewrite rules to avoid duplicate compilations