Update Makefile, fix issues in test