libmath linker dependency fix

I have added the needed Library links to the cmath library so that the FANN library compiles and links properly, not just for the examples but in general.