If you still haven't found how to link:

Go to Settings->Compiler and Debugger

Click the Linker Settings tab

In the Link Libraries group box, click add and type "winmm"

Click OK