Fix static linking

Fix builds with static linking on Linux.  (Not tested in Windows or OS X.)