Refactor the building of C programs
First version that should work (but doesn't)