Respect pre-set environment variables like JAVA_HOME
Relax gcc warning so that it will compile with DEBUG=no