In configure.ac, modify the call to PKG_CHECK_MODULES to include gtkspell-2.0, like this:
PKG_CHECK_MODULES(MYPROGRAM, gtk+-2.0 gtkspell-2.0)