RetroArch's version is pinned in the install script, installing from source will still get you the pinned version. If you update your RetroPie-Setup script, the latest version available will be 1.9.7.
If you wish to build the latest master or and another version, you need to modify the retroarch package script and change the branch used here. Note that RetroPie applies some patches to the source (here), if they don't apply correctly to the version you want to build, you'll need to comment the patches before installing from source.