no more segfaults and a debug target in Makefile