Redo build system implemented in portable C
