First run ./configure, currently this picks up f2c if it is installed which is probably not what is wanted.
Now edit ./config.cache and change the line
f2c_c_cos=${ac_cv_lib_f2c_c_cos='yes'}
to read "no"