better makefile and bugfixes