Fix the building errors and the makefile on Linux