Replace build system with autotools

This is needed by Frida in order to do out-of-tree builds for cross-
compilation with a single source tree. It also comes with the added
bonus of `configure` switches and `make dist` for building releases.