Update Makefile and fix compile error