Fix Makefile.
Add an efficient writer.