add makefiles, move to c89, clean up -Wall warnings