Added Makefile and fixed some compilation warnings