Check for terminfo libary.

This fixes another link error on my ARM device.