Use ./configure --help to see what options are available. If it's an autoconf script (most ./configure scripts are), then you can set the install directory with --prefix.
This doesn't work with everything, of course, but most developers use autoconf these days though, and most who don't have enough sense to support the --prefix option, so it should work just fine. You might want to check the Makefile (this is only created after running ./configure), there should be a line like 'prefix = /opt' (sometimes it's PREFIX), view it with less and use / to search. Occasionally you'll get a moronic package (usually in early development) that doesn't support an alternative location and you have to edit the Makefile manually, but if it has a configure script, it's rarely a problem.