Add it to what? You don't add libraries to anything. They sit there on the hard drive and you use them when you need them.
why do we need to use this option lwinmm in the first place?
The function code - the actual binary instructions that make the processor do things - live in libraries. You have to tell the linker which libraries contain the actual function code. -lwinmm is the instruction to the linker to look inside the library named winmm when it's looking for functions being called.