fix FS#1108 - [patch] fix linking and fix compiling with glibc 2.20