[PATCH v2] build: Add -ldl to LIBS as needed.