So how does the linking work?  I would have thought the linker needs to know to link against -lmpi, or has it somehow worked because libpetsc is linked against MPI?