Added debug stuff.
Made Makefile build cpp and c files with the same command.
Fixed mispelling of DBG_PRINTF.
Changed debug output to use ncurses.  This is to support emulation mode which will probably be inside an ncurses window.
Renamed debug.h to matrix-debug.h and added corresponding matrix-debug.cpp.