Drop unused libtasn1.h include

It's not only unsed, but also causes build fail because CFLAGS
for tests does not contain LIBTASN1_CFLAGS.

Signed-off-by: Stef Walter <stef@thewalter.net>

https://bugs.freedesktop.org/show_bug.cgi?id=71379
Check if pthread and nanosleep() are in libc before linking other libs

In recent versions of glibc this is true and prevents linking with
pthreads when it is not necessary.

Tweaked by Stef Walter

Signed-off-by: Stef Walter <stef@thewalter.net>