Fix #716.
Fix #716.

I finally went and read about C++ linking and understand why link
order matters and how to use it. This helped me a great deal:
https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking

stan-dev/cmdstan,stan-dev/cmdstan,stan-dev/cmdstan,stan-dev/cmdstan