Rewrite Makefile to store files in build directory