To find the point where to add the -lm in Eclipse-IDE is really horrible, so it took me some time.
If someone else also uses Edlipse, here's the way how to add the command:
Project -> Properties -> C/C++ Build -> Settings -> GCC C Linker -> Miscelleaneous -> Linker flags: in this field add the command -lm