Broken on Linux

These commits fix the build and behaviour on Linux, and document how to build on Linux.

Note that this supersedes the patch submitted in issue #9.