fix a lot warnings and make it compile
added Makefile