Gas slippage occurs when the mean free path of the gas molecules is in the order of the characteristic pore size of a porous medium. This phenomenon leads to Klinkenberg's effect where the measured permeability of a gas (apparent permeability) is higher than that of the liquid (intrinsic permeability). A generalized lattice Boltzmann model is proposed for flow through porous media that includes Klinkenberg's effect, which is based on the model of Guo et al. [Phys. Rev. E 65, 046308 (2002)]. The second-order Beskok and Karniadakis-Civan's correlation [A. Beskok and G. Karniadakis, Microscale Thermophys. Eng. 3, 43 (1999) and F. Civan, Transp. Porous Med. 82, 375 (2010)] is adopted to calculate the apparent permeability based on intrinsic permeability and the Knudsen number. Fluid flow between two parallel plates filled with porous media is simulated to validate the model. Simulations performed in a heterogeneous porous medium with components of different porosity and permeability indicate that Klinkenberg's effect plays a significant role on fluid flow in low-permeability porous media, and it is more pronounced as the Knudsen number increases. Fluid flow in a shale matrix with and without fractures is also studied, and it is found that the fractures greatly enhance the fluid flow and Klinkenberg's effect leads to higher global permeability of the shale matrix.