Fixed dynamic memory, added makefile