modify makefiles to minimize the use of LD_LIBRARY_PATH

This will help ensure that the M2 script correctly sets it and that
the needed libraries are copied into place in time.