I solved the problem by adding build_flags = -I/usr/include for [common] section in platformio.ini file.
Also install linux-libc-dev:amd64 and linux-libc-dev:i386.
Actually it is not required. It is the traditional approach which works well.
Platformio has a environment variable lib_extra_dirs which can be defined in the platformio.ini file that searches for the libraries in the directories specified here. It should accomplish the same thing.