Thanks!
The Private Lib not found since latest update topic helped to resolve the issue.
I renamed the lib folder to components and added a CMakeLists.txt file with the following content:
idf_component_register(SRCS "foo.c" INCLUDE_DIRS ".")
Then I added the following line to the CMakeLists.txt next to the plarformio.ini file:
list(APPEND EXTRA_COMPONENT_DIRS components/foo)