Using --with-foo=/path/to/foo is not Autoconf standard. It is a popular scheme added by many packages since it seems more user-friendly. However, the portability of this depends on how sophisticated the implementation is. It may work on just a few operating systems or with a few compilers.
I've found that the use of libtool negates some of these problems; telling libtool what you want to link against will allow it to decide whether LD_RUN_PATH/rpath is the right way to go, or if static linking will be required or whatever.