Fix issue #56: clean up environment before gbuild'ing

Originally proposed by cfields
Merge pull request #57 from gdm85/master

Fix issue #56: clean up environment before gbuild'ing