Adding new makefile + fix valgrind errors.