Fix configure problems related to static linking. (dm)