remove xlib linkage and unneeded libs