fix Makefile and remove warnings from memory.c