Remove use of LGTM_WORKSPACE for calling prepare_deps. The paths in that script expected the current working directory to be the repository and it works fine this way.
Move export of environment variables to the before_index section. The configure section is run in a separate step so they weren't available to the build command.