Change explicit /usr/bin/env to use global variable.

Using which or command -v instead
Also make git executable use global variable.