Cleanup plugin build machinery

    Unify embedded and external plugins configuration so that we don't
    duplicate code and bugs. While at it fix remote plugin compilation
    when the repo uri ends with .git (c&p from github).
    
    Tested compilation with plain make, external git plugin (uwsgi-realtime)
    and internal plugin with --plugin switch.