Replace build system with autotools

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

Note that `pkgconfig.mk` has been kept around to make it easier to
maintain this patch across upstream changes.