Fix switching between Fortran and C build