Fix static linking for LSF and TM

After iterating a while, this is the minimum-distance change to fix the issue.  Commits are pulled directly from master:

* open-mpi/ompi@0338bc80b7b15fb789e320e567d1e997209718f8
* open-mpi/ompi@f4aa94dddfcad9234b7a385a783a25aa11bd94c0
* open-mpi/ompi@4e8ea6f716e31abb4f3e0e356c2fe0df0935d5c2

@rhc54 reviewed.