Add support for out-of-tree builds and cross-compilation

First off, thanks a lot for this awesome framework!

Frida is about to move to Capstone, and as part of that we stumbled upon some limitations with the current build system. The issue is that Frida relies on out-of-tree builds in order to do multiple cross-compilations of a single checkout.

I don't know if this is of interest to have upstream, but just thought I'd post this pull-request just in case.