You didn't tell at which point you fail to build module. You trying to compile it on WL-500gP itself? If yes - it is really hard task for router (RAM limitation).
Can you compile firmware yourself? Have you read http://wiki.wl500g.info/index.php/co...customfirmware?