fixed petsc compile issue reported by disperato

reported at github:
https://github.com/gentoo-science/sci/issues/47

for more info, see patch comments
issue also reported to upstream maintainers