Add support for building python binding out-of-tree

Note that this breaks the Java binding, which I will address next.

Thanks!