Looking for ways to assign a variable in a Makefile based on the existence of a directory.

Eg: (pseudo code)

```
if dir "src/$(project)" exists
SOURCE_DIR := src/$(project)
else
SOURCE_DIR := src/default

test.o: $SOURCE_DIR/test.c
    gcc -c -o $@ $<

```

What's the best way to achieve the above