Fix profile.d mode and add libgfortran dependency