Update Makefile and code to compile
Merge remote-tracking branch 'upstream/master'