s3:configure: not simply check for "ld" but for the linker used by $CC
this hopefully fixes Solaris' gcc build which uses the system ld by default.
All in all we should clean up most of the compiler and linker flags depending
on the actual compilers and linkers we use. Only some tweaks are OS-specific.
A cleanup in this area should be done along with the move to a new build
system (whensoever that will be ...).
(cherry picked from commit
1969b4acc3fd7c124e288d0495b9b4665d4b42db)
Fix bug #7385 (Can't compile. Undefined symbol 'main').
(cherry picked from commit
eff42fa66e561069959c401492c3b82a09b4742b)