added checks for a clean building environment

in reference to: https://github.com/globaleaks/GlobaLeaks/issues/245