Added makefile and cleanup of code thanks to -Wall compiler settings