better genlibs.sh