autotools: Fix check for internal libraries.

Signed-off-by: Michael Lippautz <michael.lippautz@gmail.com>