if you can do it in linux, you should be able to do it in os x - check out the configure options (./configure --help should do it if it's made with autoconf). You might also need to point it to the right places to find the libraries and header files it needs for libjpeg, libpng, or whatever