Update to current makefile.
Fix endless loops and coding style.