improve makefile structure

Also, some files that should have been deleted were not removed