See also bug #116455 It's the same problem, read the README file.
Or put this line in the configure.in file.

AC_CHECK_HEADER(stocks.h,,AC_MSG_ERROR([*** LIBSTOCKS support not installed - please install first ***]))

Have a nice day,
Erik