the solution is to add #pragma lib "/$M/lib/ape/libf2c.a"
to the include file that f2c's generated code uses, and 8l will sort it out. you shouldn't need to mention libap.a, either, since something should be including an ape include file (and those have the #pragma libs)