stdio is part of the standard C library which, by default, gcc will link against.
The math function implementations are in a separate libm file that is not linked to by default so you have to specify it -lm. By the way, there is no relation between those header files and library files.