fix libdis detection, optimize tools/config.sh for $2 cases