Link libcJSON against libm

fixes #6147