gtkspell/Makefile.am contains variable references of the form @GTK_SPELL2_LIBS@. That's wrong, it should be $(GTK_SPELL2_LIBS). @foo@ syntax is used in Makefile.in by configure to populate the values of variables declared in AC_SUBST. It should be used in Makefile.am only in the context of an action involving sed.
Attached patch fixes this plus a typo (GTK_SPELL_CFLAGS when you meant GTK_SPELL3_CFLAGS).