Changed makefiles to work with SAGE

SAGE's sh sets a bunch of environmental variables.
We should have these variables set when compiling Python-dependent
modules.