I got the "-undefined dynamic_lookup" from https://github.com/verilator/verilator/issues/3283#issuecomment-1017972747
Rather long log, so adding as attachment
Seems like it was only this part of my LDFLAGS that was necessary to get the script to work export LDFLAGS=" -undefined dynamic_lookup ${LDFLAGS}"
Missing LDFLAGS in vlnggen