Fix linking with gfortran