fix LD readline on older darwin: use LDDLLFLAGS

Also add -Wl,-flat_namespace globally
mkdir ../lib may fail