Ensure PATH is set in the build environment

Without this, the build cannot find gcc.

Set GOROOT in the build environment if and only if it is set. This is
consistent with the requirements for setting GOROOT described in:
http://golang.org/doc/install#gopath