Update makefiles, backport I/O changes.