fix compile errors and update makefile