fixing silly errors, and modifying makefile to remove files with ~ at end