Waf: correctly link libm as required

Linking with Waf currently fails because of missing libm if using `LDFLAGS=-Wl,--as-needed -Wl,-z,defs`.

I don't know much about Waf so I'm not sure the fix is clean, but it seems to work.