Compile fixes.
Fixed Makefile to build keygen, core and core sim.
Debug fixes to allow building of current version.
Debug fixed to allow building of current version. Now we can drive testing.