Simplify build system

- Remove automake build system -- I don't have the knowledge to maintain
  it
- Remove Darwin-specific stuff from CMake build system -- this was
  always superfluous, and never tested.
- Combine the various CMake helper functions into a single file
Add support for eventfd even if glibc doesn't expose it

RHEL 5.10 appears to support eventfd, just not via glibc. We syscall()
it instead.