Apply 7051a3e23 to v0.7.x branch

This applies 7051a3e23b827868b2a9fb83f97d6360748d1a89 to the v0.7.x branch. The bug is only exposed when installing from another directory, with e.g. `npm install ../node-mapnik` since building from the checkout (`npm install`) works fine.