Removing glib is not a very good idea, because it's an important library and meny programs depend on it. They may just stop working when you remove the older version. Instead you can use two at the same time. Before running configure use commands
You may also need something more, but you'll see. When you have new glib installed and after changing PATH and LD_LIBRARY_PATH this way you know that everything works, only then think about removing the old version.