Root cause: missing dependencies in FANN library (Will send a patch to author). Such a dependency is called "inter library dependency".
It may happen that one build a shared library A and doesn't have correct dependencies set (let's say B). In such a case a shared library A will be build without any error msg as it's not required to provide implementation during compiling.
The problem will appear as a lack of library B when one try to create an executable file which depends on A.
In this specific case a solution is to modify a CMake configuration file according to CMake manual
Example changeline:
TARGET_LINK_LIBRARIES(fann m)