In order to build a program, you need to tell Automake which sources are part of it, and which libraries it should be linked with.
This section also covers conditional compilation of sources or programs. Most of the comments about these also apply to libraries (see Building a library) and libtool libraries (see Building a Shared Library).