With following diff of Makefile,

<verbatim>
diff Makefile Makefile.orig
39c39
< # LIB += -lsocket
---
> # LIB += lsocket
41c41
< LIB += -lsocket -lnsl
---
> # LIB += -lsocket -lnsl

</verbatim>

I was able to build fossil on opensolaris b124.

<verbatim>
uname -a
SunOS 600m 5.11 snv_122 i86pc i386 i86pc Solaris
cat
                       OpenSolaris Development snv_122 X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 28 August 2009
ls -l fossil
-rwxr-xr-x 1 root root 1582864 2009-10-13 23:37 fossil

</verbatim>