configure.py: enable separate build directories

With this change it is now possible to run configure.py
from a separate directory and have build.ninja and all
build projects written there rather than within the source
checkout. This works in a similar way to autoconf-generated
configure scripts.

This allow multiple different build trees to exists
based on a single ninja checkout.