Modifying those functions to just return 0 helped. Apart from some warnings I now only get the following:
I don't understand the first one there is no is_valid_double function i prime.c.Code:prime.o(.text+0xa713): In function `is_valid_double': : undefined reference to `eisvaliddouble' gw/mult.o(_TEXT32+0x5f): In function `_gwinfo1': : undefined reference to `_CPU_L2_CACHE_SIZE' collect2: ld returned 1 exit status make: *** [sbfactor] Error 1