How to add libraries path to the ./configure command?

You missed the meaning of

Some influential environment variables:

So you set them as an environment variable; configure determines LDFLAGS and CPPFLAGS by checking config files and the environment. You can set them like this ...

export CPPFLAGS='-I/home/foo/sw/include/'
export LDFLAGS='-L/home/foo/sw/lib/'
./configure

or as a one-liner:

env CPPFLAGS='-I/home/foo/sw/include/' LDFLAGS='-L/home/foo/sw/lib/' ./configure

Please note that it is possible that you cannot use subdirectories under /home/foo/sw/lib/

f.e. putting your library in /home/foo/sw/lib/bar/ might show you a lib not founderror.

However you can use multiple entries:

LDFLAGS="-L/home/foo/sw/lib/ -L/home/foo/bar/lib/"