I've built a few shared libraries on BeOS and run into some common problems. Here they are (with fixes):
Build complains about bad argument to gcc "-shared"
The BeOS gcc does not use the -shared flag. If you take this flag out you will (probably) get a complaint about lacking a main() function. Add the flag "-nostart" which removes the startup code. (including the call to main)
The application is using libtool, and it builds a static, but not a shared, library
You may see a warning about building shared libraries with undefined symbols being unsupported on BeOS. Most likely, your library has all the symbols defined. In this case, you should modify the Makefile, Makefile.in, etc. to add the flag "-no-undefined" to the variable libraryname_la_LDFLAGS. Here is an example:
libmp3lame_la_LDFLAGS = -no-undefined -version-info 0:0
After doing this you may have to delete the libraryname.la that is in the directory above ".libs". Doing this should cause libtool to rebuild the libraries, including the shared library.
configure refuses to accept that ld is from gnu, even after --with-gnu-ld
I came across this problem building libdvdcss 1.2.7. The configure script was generated by autoconf 2.57. It used a grep command somewhat like this: egrep '(GNU|with)' This type of grep command doesn't work in any grep before 2.5. You can download a current grep on bebits.