Add Makefile, fix tests