node: add with-shared-libs option

Closes #17900.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>