Add Makefile, fix broken C.

1. Make function prototypes be prototypes.
2. Fix various bad initializers (missing braces, initialise from
   non-const)
3. Sprinkle some attributes around, const since most functions are
   totally pure functions, one unused and one noreturn