When you use Gnulib, you need to augment the set of libraries against which
your programs and libraries are linked. This is done by augmenting the
LDADD (for all programs) or
prog_LDADD (for a single program
library_la_LIBADD (for a single library
What do you need to add to this Automake variable?
lib/libgnu.afor source in the top-level directory, or
../lib/libgnu.afor source in a sibling directory of
gnulib-tool. Alternatively, you can retrieve the set of additional libraries required by a specific Gnulib module by running
./gnulib-tool --extract-recursive-link-directive module
Beware: By looking into the module description file
or by running
./gnulib-tool --extract-link-directive module
you would miss the link dependencies of indirectly used modules.