How Can I rebuild the GPU libs or 2D libs for other filesystem

I am running other filesystem on the RB5.Because the screen is so slowly by CPU.so I want to know the method of rebuild the GPU lib or 2D libs.
Please help!

I would have thought the mesa docs would cover this: Compiling and Installing — The Mesa 3D Graphics Library latest documentation

Thank you for your answer, i will try it