Run T9762 only if dynamic libraries are available

(cherry picked from commit 1dcef98a77afa0f9dc73896b8d8cc7444e2e0039)