checkLink: use C++ linker for checkLink if package sets self.cxx

PETSc will use the C++ linker in this case. This is needed when an
external library uses C++, but exports a C interface that we are
testing.
Merged in jed/checklink-cxx (pull request #2)

checkLink: use C++ linker for checkLink if package sets self.cxx