Add build env speedup

This PR will hopefully help solving issue #199.