pkg-config is adding a layer of confusion, because you are trying to link with self built packages, not system installed packages. I’m not sure how to solve your original question, but it is not likely pkg-config will help unless you prefer to install h5fortran using apt in the WSL Ubuntu, and link to that version instead.