fixed bug
add determination of system for linking math library