See Part I
Beginning with wine 0.9.57 "-lsunmath" is needed. You can get the libsunmath library from blastwave, for example:
LIBS = -lsocket -lnsl -lintl -L/opt/csw/lib -lsunmath
This is the error you might get if the library is not specified in dlls/wined3d/Makefile:
Undefined first referenced
symbol in file
ld: fatal: Symbol referencing errors. No output written to wined3d.dll.so
collect2: ld returned 1 exit status
winegcc: gcc failed
gmake: *** [wined3d.dll.so] Error 2
gmake: Leaving directory `/var/tmp/wine-0.9.57/dlls/wined3d'
gmake: *** [wined3d] Error 2
gmake: Leaving directory `/var/tmp/wine-0.9.57/dlls'
gmake: *** [dlls] Error 2
The isinf related discussion can be found here.