Add -lm/-lm_hard before -lc

Change-Id: I0267ba32f7451db984220e7e49196c70f7133987