makefile fixes, built successfully but it crashes with a bus error