Wrong install by git link of lib without manifest

Yes, see Include libraries from github - #2 by maxgerhardt and PlatformIO downloads subfolder - #4 by maxgerhardt. Since the linked library has no manifest file (library.json), PlatformIO crawls the subfolders in the search for the source folder, and finds source files in test/ in this case. This logic is contained in find_library_root(), and it fails for the folder structure of your target library.

Fixes as done to close e.g. Library without includeDir unpredictable · Issue #3887 · platformio/platformio-core · GitHub is adding more special cases in the detection logic. In this case for e.g. per Add "inc" as sign that it's the root of the library by maxgerhardt · Pull Request #4093 · platformio/platformio-core · GitHub.

The safest way to use a non-PlatformIO library within PlatformIO is to make it explicitly PlatformIO-compatible, that is, by forking it and giving it a library.json.