Fixed compilation errors, updated Makefile