Build documentation conditionally

Building documentation for disabled libraries fails with the
following error:

```
libtool: link: cannot find the library `../../../libinfgtk/libinfgtk-0.6.la' or unhandled argument `../../../libinfgtk/libinfgtk-0.6.la'
Linking of scanner failed:
Makefile:609: recipe for target 'scan-build.stamp' failed
```