build: Fix boost build on some platforms

When the libpath doesn't line up with the value from config.sub, we don't find
the correct path to boost's libs. This adds a hack to try another path before
giving up.

Should close #3219.
Merge pull request #4704

54c7df8 build: Fix boost build on some platforms (Cory Fields)