In the first case it looks like the libraries listed in the make output were detected by configure, but for some reason it can't link against them. Setting LDFLAGS to include /opt/csw/lib in the library search directory could help:
./configure --with-curl=/opt/csw --with-openssl=/opt/csw --with-expat LDFLAGS="-L/opt/csw/lib"
If this doesn't work, check the architecture of the libraries in /opt/csw/lib and the architecture of binaries produced by the compiler used in the compilation. I don't know about SPARC, but 32-bit vs 64-bit mismatch can happen quite easily on x86. Also checking the output of configure for which libraries were found and which not and the linker command (a verbose option to make may be needed for that) could reveal the cause of the errors.
I could now compile git v2.25 on Solaris 10
install git from openCSW
necessary for existance of /opt/csw/libexec/git-core/git-remote-https
download current git:
(git-compile-node) $ cd /tmp ; git clone https://github.com/git/git.git
(git-compile-node) $ unzip -q git-master.zip
copying from a working S10 node, because git-remote-https is necessary for https:
(solaris 10 node) $ scp /opt/csw/libexec/git-core/git-remote-https (git-compile-node):/opt/csw/libexec/git-core/
(git-compile-node) /export/home/labuser/git-2.25.1 $ ./configure --with-curl=/opt/csw/lib/libcurl.so --with-openssl=/opt/csw/lib/libssl.so --with-expat
(git-compile-node) /export/home/labuser/git-2.25.1 $ make -j4
(git-compile-node) /export/home/labuser/git-2.25.1 $ make install
(git-compile-node) $ /usr/local/bin/git --version
(git-compile-node) $ /usr/local/bin/git clone https://github.com/git/git.git