From memory, I think you also need a capital -L, to indicate the path where the library is stored.
EDIT: actually, looking at your output, it looks like as if it didn't recognise '-l' at all. Not sure why.
Anyway, as mentioned by others, the reasons to want to do this for microcontroller software are
slim (never needed to do this in hundreds of programs). It's not like a PC where a library can be
reused by different software on the fly. You always know if your microcontroller app needs it or not.
It would be done for a microcontroller if you didn't want to distribute source code, i.e. if are you
planning to sell library code.