fix makefile and some tests