Improved Makefile and fix some warnings