Update Makefile and fix warnings